package com.zzty.txj.serviceImpl;


import com.alibaba.fastjson.JSONObject;
import com.zzty.txj.entity.Clazz;
import com.zzty.txj.service.ClazzService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.List;

import static com.zzty.txj.util.HttpUtil.httpGet;

@Service
public class ClazzServiceImpl implements ClazzService {
    @Value("${getClazz}")
    String url;
    @Override
    public List<Clazz> getClazz(){
        String us=null;
        try {
            us = httpGet(url);
        } catch (Exception e) {
            e.printStackTrace();
        }
        List<Clazz> clazzes=JSONObject.parseArray(us,Clazz.class);
        return clazzes;
    }
}
